{extend name="base" /}

{block name="content"}
<form class="layui-form" action="" id="searchBox">
    <div class="layui-inline">
        <div class="layui-input-inline" style="width:400px; padding-top:10px; color: #444;">
            <span style="color:#ff0000">*</span>用于更新梦幻神宠拍卖行神兽
        </div>
    </div>
    <br>
    <br>
    <div class="layui-inline">
        <div class="layui-input-inline" style="width:400px;">
            <select name="server" id="server" lay-filter="server" lay-search="">
                <option value="">请选择梦幻神宠区服（全部）</option>
                {volist name="$server" id="vo"}
                <option value="{$vo.server}">{$vo.servername}</option>
                {/volist}
            </select>
        </div>
    </div>
    <br>
    <br>
    <div class="layui-inline">
        <div class="layui-input-inline" style="width:400px;">
            <select name="cmd1" id="cmd1" lay-filter="cmd1" lay-search="">
                <option value="">请选择神兽（全部）</option>
                {volist name="$cmd" id="vo"}
                <option value="{$vo.cmd}">{$vo.desc}</option>
                {/volist}
            </select>
        </div>
    </div>
    <br>
    <br>
    <div class="layui-inline">
        <div class="layui-input-inline" style="width:400px;">
            <select name="cmd2" id="cmd2" lay-filter="cmd2" lay-search="">
                <option value="">请选择神兽（全部）</option>
                {volist name="$cmd" id="vo"}
                <option value="{$vo.cmd}">{$vo.desc}</option>
                {/volist}
            </select>
        </div>
    </div>
    <br>
    <br>
    <div class="layui-inline">
        <a href="javascript:;" class="layui-btn searchBtn my-btn my-btn-sm" style="width:400px;">更新神兽</a>
    </div>
</form>

{/block}

{block name="css"}
{/block}

{block name="js"}
<script>
    layui.use(['table', 'layer'], function(){
        var $ = layui.$
            ,layer = layui.layer
            ,load = '';

        $('#searchBox .searchBtn').on('click', function(){
            layer.confirm('确定要更新神兽吗？', {offset: '250px'}, function(index){
                $.post('{:url("GameUpdate/index")}',{server: $('#server').val(), 'cmd1': $('#cmd1').val(), 'cmd2': $('#cmd2').val()}, function(json){
                    if(json.code==0){
                        layer.msg(json.msg, {icon: 1, time:3000})
                    }else{
                        layer.msg(json.msg, {icon: 0, time:3000});
                    }
                }, 'JSON').error(function(){
                    layer.close(load);
                    layer.msg('连接超时，请联系后台管理员', {icon: 2, time:3000});
                });
            });
            return false;
        });

    });
</script>
{/block}